package local.sumw3.findmydevices.object.bean;

import local.sumw3.json.JSONException;
import local.sumw3.json.JSONObject;

public class User {
    private String lastName;

    private String firstName;

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public static User parseFromJSON(JSONObject obj) throws JSONException {
        User user = null;
        if (obj != null) {
            JSONObject jsonUser = obj.getJSONObject("userInfo");
            if (jsonUser != null) {
                user = new User();
                user.setFirstName(jsonUser.getString("firstName"));
                user.setLastName(jsonUser.getString("lastName"));
            }
        }
        return user;
    }
}
